#include <iostream>
#include <stdlib.h>
#include <time.h>
#include "include/bubblesort.h"
#include "include/choicesort.h"
#include "include/insertsort.h"
#include "include/shellsort.h"
#include "include/quicksort.h"
#include "include/mergesort.h"
#include "include/heapsort.h"
#include "include/radixsort.h"

using namespace std;


int main(int argc, const char** argv) {
    const int COUNT = 100000;
    int *arr_bubble = new int[COUNT];
    int *arr_selcet = new int[COUNT];
    int *arr_insert = new int[COUNT];
    int *arr_shell = new int[COUNT];

    srand(time(NULL));
    cout << "start" << endl;
    for (int i = 0; i < COUNT; i++) {
        arr_bubble[i] = rand() % COUNT;
        arr_selcet[i] = arr_bubble[i];
        arr_insert[i] = arr_bubble[i];
        arr_shell[i] = arr_bubble[i];
    }

    clock_t start = clock();
    bubbleSort(arr_bubble, COUNT);
    clock_t end = clock();

    cout << "bubble sort: " << (end - start) << endl;

    start = clock();
    ChoiceSort(arr_selcet, COUNT);
    end = clock();

    cout << "select sort: " << (end - start) << endl;

    start = clock();
    InsertSort(arr_insert, COUNT);
    end = clock();

    cout << "insert sort: " << (end - start) << endl;

    start = clock();
    ShellSort(arr_shell, COUNT);
    end = clock();
    cout << "shell sort: " << (end - start) << endl;

    start = clock();
    QuickSort(arr_shell, COUNT);
    end = clock();

    cout << "quick sort: " << (end - start) << endl;

    start = clock();
    MergeSort(arr_shell, COUNT);
    end = clock();

    cout << "merge sort: " << (end - start) << endl;

    start = clock();
    HeapSort(arr_shell, COUNT);
    end = clock();

    cout << "heap sort: " << (end - start) << endl;

    start = clock();
    RadixSort(arr_shell, COUNT);
    end = clock();

    cout << "radix sort: " << (end - start) << endl;

    return 0;
}